var createNode = require('./create-node');

function genElementChildren(element, parentEl, beforeEl) {
    parentEl = parentEl || element.el;
    var anodeChildren = element.aNode.children;
    for (var i = 0; i < anodeChildren.length; i++) {
        var child = createNode(anodeChildren[i], element);
        element.children.push(child);
        child.attach(parentEl, beforeEl);
    }
}
exports = module.exports = genElementChildren;
